package com.qf.mxbc.controller;

import com.qf.mxbc.pojo.Img;
import com.qf.mxbc.result.ApiStatus;
import com.qf.mxbc.result.ResponseData;
import com.qf.mxbc.service.ImgService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("img")
public class ImgController {
    @Resource
    private ImgService imgService;

    @RequestMapping("/{type}")
    public ResponseData<List> getImgByType(@PathVariable Integer type){
        List<Img> imgList =imgService.getImgByType(type);
        return new ResponseData<>(ApiStatus.SUCCESS,imgList);
    }

}
